﻿#pragma once

#include <QVector>
#include <QVector3D>
#include <QMatrix4x4>
#include <QOpenGLWidget>
#include <QOpenGLBuffer>
//#include <QOpenGLFunctions>
#include <QOpenGLVertexArrayObject>
#include <QOpenGLShader>
#include <QOpenGLShaderProgram>
#include <QOpenGLFunctions>

#include <QVector4D>

#include "MyGLXYZPainter.h"
#include "AsGLCoordPainter.h"

class MyOpenGLWidget  : public QOpenGLWidget, QOpenGLFunctions
{
	Q_OBJECT

public:
	MyOpenGLWidget(QWidget *parent = nullptr);
	~MyOpenGLWidget();

protected:
	void initializeGL() override;
	void paintGL() override;
	void resizeGL(int w, int h) override;

private:
	void drawCoordinateAxes();

private:
	QOpenGLBuffer m_vbo;
	QVector<QVector3D> points;
	QOpenGLShaderProgram *shaderProgram;
	QOpenGLBuffer vbo;
	QOpenGLVertexArrayObject vao;
	QMatrix4x4 projectionMatrix;
	QMatrix4x4 viewMatrix;
	QMatrix4x4 modelMatrix;

	MyGLTransParam m_transformParam;

};
